1. Field of Invention
The present invention relates to an optical signal detection method and apparatus for a computer mouse, and more particularly to a detection technology which calculates a reference voltage signal based on the input signal from a moving mouse, to precisely determine the movement status of the mouse.
2. Related Art
With reference to FIG. 7, a part of a conventional circuit, where only the X-axis detecting circuit is shown, for detecting the signals of a computer mouse comprises a roller ball (60), a disk (61) defined with multiple radially extending slits (not numbered), a light emission diode (62), two photo-transistors (63, 64) and two comparators (65, 66). The disk (61) is secured to a rotary shaft that is driven by the roller ball (60).
When a user operates the mouse, the rotary ball (60) transmits the disk (61) to rotate via the rotary shaft, whereby the two photo-transistors (63, 64) can be turned on/off by the discontinuous light signals that are emitted from the light emission diode (62) through the slits of the disk (61). By determining the phase difference of the two output signals (X1, X2) from the two photo-transistors (63, 64), the movement direction along the X-axis of the mouse is recognized. Furthermore, the detection of the movement direction along the Y-axis is achieved by another pair of photo-transistors (not shown). Since the operation of the Y-axis photo-transistor is substantially the same as the foregoing description, the explanation for the Y-axis photo-transistor is omitted.
Since the voltage level of the output signal from the two photo transistors (63, 64) will vary with the movement speed of the mouse, two rheostats (R1, R2) are provided to fine tune the voltage level. By choosing an appropriate resistance value of each rheostat (R1, R2), the voltage level can be properly controlled in the allowable range, so that the two comparators (65, 66) can be operated correctly.
However, since the reference voltage level of each comparator (65, 66) is predetermined, and the resistance value of each rheostat (R1, R2) is set as a proper constant value, once the voltage level of the output signals of each photo-transistor (63, 64) is over low or over high, the comparators (65, 66) can not correctly determine whether the photo-transistors (63, 64) are turned on or not. Thus the movement of the computer mouse can not be precisely presented.
With reference to FIG. 8, to solve the foregoing problem, another conventional signal detection circuit has been developed. The circuit utilizes a comparator (71) to receive the output signal of a photo-transistor (70). A reference voltage (Vxe2x88x92), which is input to a terminal denoted with xe2x80x9cxe2x88x92xe2x80x9d, of the comparator (71) is a feedback signal, wherein the feedback signal is from the output of the comparator (71) which be further processed by an up/down counter (72) and a D/A converter (73). By using such a circuit design, the comparator (71) obtains a variable reference voltage (Vxe2x88x92) based on the output signal of the photo-transistor (70). Although such a circuit design having the variable reference voltage can overcome the drawback of the foregoing circuit of FIG. 7, the entire circuit layout becomes more complex than that because the up/down counter (72) and the D/A converter (40) are involved. Further, the manufacturing cost of such a circuit is high.
To overcome the shortcomings, the present invention provides an optical signal detection method and apparatus for a computer mouse to mitigate and obviate the aforementioned problems.
An objective of the invention is to provide an optical signal detection method and apparatus for a computer mouse to calculate a variable reference voltage based on the output signal of the photo-transistor and to provide to a comparator, so as to make the comparator accurately determine the movement of the computer mouse.
Another objective of the invention is to provide an optical signal detection method and apparatus for a computer mouse to simplify the circuit design and reduce the production cost.
To achieve the objectives, the apparatus in accordance with the present invention comprises:
a comparator comparing a first output signal X1 of a first photo-transistor with a second output signal X2 of a second photo-transistor to output a reference signal;
a pulse signal generating unit connected to the output of the comparator to generate the pulse signals based on the rising edges or falling edges of the reference signal;
a sample and hold circuit connected to the output of the pulse signal generating unit, the first photo-transistor and the second transistor, to sample and hold the voltage value of the output signal of the two photo-transistors based on said pulse signals;
a dynamic reference voltage generating unit connected to the output of the sample and hold circuit to calculate a dynamic reference voltage according to the sampled and held voltage value;
wherein by comparing said dynamic reference voltage with the output signal of the photo transistors, digital signals representing the on/off statuses of the photo-transistors are accurately obtained, and the digital signals are further processed to determine the movement of the computer mouse.
Other objects, advantages and novel features of the invention will become more apparent from the following detailed description when taken in conjunction with the accompanying drawings.